package com.bawan.web.happy.user.action;

import com.bawan.web.happy.user.entity.UserEntity;
import com.bawan.web.happy.user.service.UserService;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.ModelDriven;

/**
 * <p> Description	: RegisterAction.java </p>
 * <p> Copyright	: Copyright (c) 2015 by PCI-SUNTEK</p>
 * <p> Author 		: ZCCHUN </p>
 * <p> Create		: 2015年10月23日 上午10:03:57 </p> 
 * <p> version 		: 1.0 </p>
 */
public class RegisterAction extends ActionSupport implements ModelDriven<UserEntity> {
	private static final long serialVersionUID = 3697069953364630864L;
	private UserEntity user = new UserEntity();
	private UserService userService;
	private String result;
	public UserEntity getModel() {
		return user;
	}
	public String getResult() {
		return result;
	}
	public UserService getUserService() {
		return userService;
	}
	public void setUserService(UserService userService) {
		this.userService = userService;
	}
	public String execute() {
		userService.addUser(user);
		result = "用户注册成功!";
		return SUCCESS;
	}
}
